#include <iostream>
#include <QApplication>

#include "use_add_dialog.h"

int main2(int argc,char**argv){
   
    QApplication qa(argc,argv);
    UiAddPol ua;
    int result;
    
    result=ua.exec();
    std::cout << "The result from the dialog is : "<<result<<std::endl;

    if(result==0){
        std::cout << "Nothing will happen sorry"<<std::endl;
        
    }
    else{
        
        std::cout << "User accepted things: "<<result<<std::endl;
        QString t=ua.comboPolicy->currentText();
        std::cout << "Chosen policy is : "<<t.toStdString()<<std::endl;


        QItemSelectionModel *qm = ua.treePersonList->selectionModel();
        QList<QModelIndex> qli = qm->selectedRows();

        for(int i=0;i<qli.size();i++){
        std::cout << "Chosen person  is : "<<qli.at(i).data().toString().toStdString()<<std::endl;
        }

    }

}
